package com.xinqi.modules.course.clazz.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.mybatis.data.repo.SuperMapper;
import com.xinqi.modules.course.clazz.domain.ClassJoinAuditEntity;
import com.xinqi.modules.course.clazz.dto.req.ClassJoinAuditQueryDTO;
import com.xinqi.modules.course.clazz.dto.rsp.ClassJoinAuditResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 学生加入班级审核数据层
 *
 * @author: system
 * @date: 2023/01/17
 */
@Mapper
public interface ClassJoinAuditMapper extends SuperMapper<ClassJoinAuditEntity> {
    IPage<ClassJoinAuditResultDTO> pageList(Page<Object> page, @Param("query") ClassJoinAuditQueryDTO query);

    List<ClassJoinAuditResultDTO> findList(@Param("query") ClassJoinAuditQueryDTO query);

    ClassJoinAuditResultDTO detail(@Param("id") Long id);

    ClassJoinAuditResultDTO findLatestStatusByUserIdAndClassId(@Param("studentId") Long studentId, @Param("classId") Long classId);

    Integer findAuditCount(@Param("query") ClassJoinAuditQueryDTO query);
}
